import { S } from '../../s';
import { IPSApplication } from '../ipsapplication';
import { IPSAppViewMsg } from './ipsapp-view-msg';
import { IPSAppViewMsgGroupDetail } from './ipsapp-view-msg-group-detail';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSAppViewMsgGroupDetailImpl
  extends PSModelObjectImpl
  implements IPSAppViewMsgGroupDetail
{
  protected psappviewmsg: IPSAppViewMsg;
  getPSAppViewMsg(): IPSAppViewMsg | null {
    if (this.psappviewmsg != null) return this.psappviewmsg;
    const value = this.M.getPSAppViewMsg;
    if (value == null) {
      return;
    }
    const ipsapplication = this.getParentPSModelObject(
      S._26e,
    ) as IPSApplication;
    if (ipsapplication != null) {
      this.psappviewmsg = ipsapplication.findPSAppViewMsg(value);
    }
    return this.psappviewmsg;
  }

  get position(): 'TOP' | 'BOTTOM' | 'BODY' | 'POPUP' | 'CUSTOM' {
    return this.M.position;
  }
  get cls(): string {
    return 'PSAppViewMsgGroupDetailImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._84) return true;
    return super.instanceof(cls);
  }
}
